package com.hdaccp.letting.service;

import com.hdaccp.letting.bean.User;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

@Component
public class UserServiceSub implements UserService {
    @Resource
   private UserService userService ;
   public UserServiceSub (UserService userService){
       this.userService = userService ;
   }
    @Override
    public User getUser(int id) {
       User user = null ;
        System.out.println("sub....");
        if(id<=0){
            throw  new RuntimeException("id应大于0");
        }
        else{
           user =  userService.getUser(id) ;
        }
        return user;
    }
}
